class APIError(Exception):
    pass


class ParameterRequiredError(APIError):
    def __init__(self, params):
        self.params = params

    def __str__(self):
        return "%s is mandatory, but received empty." % (", ".join(self.params))


class UnauthorizedError(APIError):
    """Thrown when the server returns code 401."""

    pass


class ForbiddenError(APIError):
    """Thrown when the server returns code 403."""

    pass


class InternalServerError(APIError):
    """Thrown when the server returns code 500."""

    pass


class BadGatewayError(APIError):
    """Thrown when the server returns code 502"""

    pass
